package org.tuoren.official.es.domain;

import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * 文章业务对象 article_detail
 *
 * @author wl
 * @date 2024-06-12
 */
@Data
@IndexName(value = "blog_article")
public class ArticleDetailEs implements Serializable {

    private static final long serialVersionUID = -1L;

    /**
     * 主键
     */
    @IndexId
    private Long id;

    /**
     * 所属分类ID
     */
    private Long typeId;
    /**
     * 国家ID
     */
    private String countryId;

    /**
     * 标题
     */
    @IndexField(fieldType = FieldType.TEXT,
        analyzer = Analyzer.IK_MAX_WORD, searchAnalyzer = Analyzer.IK_SMART)
    @HighLight(preTag = "<text style='color:red'>",postTag = "</text>")
    private String title;
    /**
     * 来源
     */
    private String articleSource;

    /**
     * 封面
     */
    private String articleCover;

    /**
     * 描述
     */
    @IndexField(fieldType = FieldType.TEXT,
        analyzer = Analyzer.IK_MAX_WORD, searchAnalyzer = Analyzer.IK_SMART)
    @HighLight(preTag = "<text style='color:red'>",postTag = "</text>")
    private String articleDesc;

    /**
     * 内容详情
     */
    @IndexField(fieldType = FieldType.TEXT,
        analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<text style='color:red'>",postTag = "</text>",fragmentSize=70)
    private String articleContent;

    /**
     * 附件
     */
    private String articleAnnex;

    /**
     * 是否显示
     */
    private Integer showStatus;


    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 创建人
     */
    private String createBy;
    private String createAuthor;

    private Long commentCount;
}
